<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <input type="file" id="input">
    <img src="" alt="" id="imgSrc">
    <script>
        let input = document.getElementById("input");
        input.addEventListener('change', fileFormData, false);
        function fileFormData(){
            let files = this.files[0];
            let formData = new FormData();
            console.log(formData);
            formData.append('file', files);
            formData.append('a', 'a1');
            console.log(files);
            console.log(formData)
        }
    </script>
</body>
</html>
